Security News
ESLint is Now Language-Agnostic: Linting JSON, Markdown, and Beyond
ESLint has added JSON and Markdown linting support with new officially-supported plugins, expanding its versatility beyond JavaScript.
universal-env
Advanced tools
判断和获取运行时环境
$ npm install universal-env --save
import { isWeex, isWeb, isMiniApp, isNode, isWeChatMiniProgram, isByteDanceMicroApp, isQuickApp, isBaiduSmartProgram, isKuaiShouMiniProgram } from 'universal-env';
isWeex: boolean
校验 Weex 环境
isWeb: boolean
校验 Web 环境
isMiniApp: boolean
校验阿里小程序环境
isWeChatMiniProgram: boolean
校验微信小程序环境
isByteDanceMicroApp: boolean
校验字节跳动小程序环境
isBaiduSmartProgram: boolean
校验百度小程序环境
isKuaiShouMiniProgram: boolean
校验快手小程序环境
isQuickApp: boolean
校验快应用环境
isNode: boolean
校验 Node.js 环境
注:以下各小程序 WebView 内容器判断依赖 WebView 中注入容器的JS SDK。
isMiniApp | isWeChatMiniProgram | isByteDanceMicroApp | isQuickApp | isWeb | isWeex | isNode | isKuaiShouMiniProgram | isBaiduSmartProgram | |
---|---|---|---|---|---|---|---|---|---|
阿里小程序 | ✔️ | ✘ | ✘ | ✘ | ✘ | ✘ | ✘ | ✘ | ✘ |
阿里小程序 WebView | ✔️ | ✘ | ✘ | ✘ | ✔️ | ✘ | ✘ | ✘ | ✘ |
微信小程序 | ✘ | ✔️ | ✘ | ✘ | ✘ | ✘ | ✘ | ✘ | ✘ |
微信小程序 WebView | ✘ | ✔️ | ✘ | ✘ | ✔️ | ✘ | ✘ | ✘ | ✘ |
字节跳动小程序 | ✘ | ✘ | ✔️ | ✘ | ✘ | ✘ | ✘ | ✘ | ✘ |
字节跳动小程序 WebView | ✘ | ✘ | ✔️ | ✘ | ✔️ | ✘ | ✘ | ✘ | ✘ |
快手小程序 | ✘ | ✘ | ✔️ | ✘ | ✘ | ✘ | ✘ | ✔️ | ✘ |
快手小程序 WebView | ✘ | ✘ | ✔️ | ✘ | ✔️ | ✘ | ✘ | ✔️ | ✘ |
百度小程序 | ✘ | ✘ | ✘ | ✘ | ✘ | ✘ | ✘ | ✘ | ✔️ |
百度小程序 WebView | ✘ | ✘ | ✘ | ✘ | ✘ | ✘ | ✘ | ✘ | ✔️ |
快应用 | ✘ | ✘ | ✘ | ✔️ | ✘ | ✘ | ✘ | ✘ | ✘ |
快应用 WebView | ✘ | ✘ | ✘ | ✘ | ✔️ | ✘ | ✘ | ✘ | ✘ |
Weex | ✘ | ✘ | ✘ | ✘ | ✘ | ✔️ | ✘ | ✘ | ✘ |
Node | ✘ | ✘ | ✘ | ✘ | ✘ | ✘ | ✔️ | ✘ | ✘ |
Web | ✘ | ✘ | ✘ | ✘ | ✔️ | ✘ | ✘ | ✘ | ✘ |
FAQs
The npm package universal-env receives a total of 1,446 weekly downloads. As such, universal-env popularity was classified as popular.
We found that universal-env demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 6 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
ESLint has added JSON and Markdown linting support with new officially-supported plugins, expanding its versatility beyond JavaScript.
Security News
Members Hub is conducting large-scale campaigns to artificially boost Discord server metrics, undermining community trust and platform integrity.
Security News
NIST has failed to meet its self-imposed deadline of clearing the NVD's backlog by the end of the fiscal year. Meanwhile, CVE's awaiting analysis have increased by 33% since June.